﻿@model IEnumerable<eBusiness.Models.News>
<table class="dashboardTable">
    <tr>
        <th style="width: 95px">
            ThumbImage
        </th>
        <th>
            Title
        </th>
        <th>
            Summary
        </th>
        <th>
            CreatedBy
        </th>
        <th>
            CreatedDate
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                <img src="@item.ThumbImage" class="smallThumbImage" alt="image" />
            </td>
            <td>
               <a href="@Url.Action("Details","News", new {id = @item.ID})"> @Html.DisplayFor(modelItem => item.Title)</a>
            </td>
            <td>
                @*@Html.DisplayFor(modelItem => item.Details)*@
            </td>
            <td>
                @{
                        if (item.CreatedBy != null && !string.IsNullOrEmpty(item.CreatedBy.ToString()))
                    {
                        var membershipUser = Membership.GetUser(item.CreatedBy);
                        if (membershipUser != null)
                        {
                            var usr = membershipUser.UserName;
                            @usr
                        }
                    }
                }
            </td>
            <td>
                @if (item.CreatedDate != null && !string.IsNullOrEmpty(@item.CreatedDate.Value.ToString()))
                            {
                                @item.CreatedDate.Value.ToString("dd/MM/yyyy")
                            }
            </td>
        </tr>
    }
</table>
